<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
   



         
        <script>
               /*
                     
                    箭头函数没有自己的this 
                    他的this指向 函数创建的时候  
                    this的指向
               */

                var _name="global" 
                var obj={
                    func() {
                       const innerFunc=()=>{
                            console.log(this._name)
                       } 
                    //   console.log(this._name)
                    //    function innerFunc(){
                    //         console.log(this._name)
                    //    } 
                       return  innerFunc
                    },
                    _name:"local" 
                }
                 obj.func()()    //local
                // var  func=obj.func
                // func()()          //global

                // obj.func.bind({_name:"newObj"})()()  //newObj

               // obj.func.bind()()()  //global
               
               //this 一旦被bind后 就不会再被 call apply修改
               //obj.func.bind({_name:"newObj"}).apply({_name:"appObj"})()  //newObj









        </script>

      
</body>
</html>